using UnityEngine;

public class PlayerPhysicsCheck : PhysicsCheck {
    [Header("攀爬检测")]
    public Transform climbCheckPoint;
    public float climbCheckLength;
    public bool isCheckClimb;

    public override void Check(){
        base.Check();
        // 攀爬检测
        bool isClimbTouchWall = Physics2D.Raycast(climbCheckPoint.position, Vector3.right * transform.localScale.x, climbCheckLength, wallLayer);
        if(!isClimbTouchWall && isTouchWall){
            isCheckClimb = true;
        }else{
            isCheckClimb = false;
        }
    }

    public override void OnDrawGizmos()
    {
        base.OnDrawGizmos();
        Gizmos.DrawLine(climbCheckPoint.position, climbCheckPoint.position + Vector3.right * transform.localScale.x * climbCheckLength);
    }
}